using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace SunshineFarmWord
{
    public class PlayerRollState : PlayerBaseStates
    {
        public PlayerRollState(PlayerStateMachine playerStateMachine) : base(playerStateMachine)
        {
        }

        #region Base Function
        public override void Enter()
        {
            base.Enter();

            StartAnimation(stateMachine.Player.AnimationData.RollParameterHash);
        }

        public override void Exit()
        {
            base.Exit();

            StopAnimation(stateMachine.Player.AnimationData.RollParameterHash);
        }

        public override void PhysicsUpdate()
        {
            base.PhysicsUpdate();

            Move();
        }
        #endregion


        #region 动画回调
        public override void OnAnimationExitEvent()
        {
            base.OnAnimationExitEvent();

            stateMachine.ChangeState(stateMachine.IdlingState);
        }
        #endregion
    }
}
